/* GSManufactureExcelDetailAction.java
 *
 * Project/Product: APEP-JZCG
 *
 * Modify Information:
 * =============================================================================
 *   Author	Date       Description
 *   ----------	---------- ---------------------------------------------------
 *   peng.ning	2008-10-29	First release
 *
 * Licensed Materials - Property of APEP
 * =============================================================================
 *    (C) COPYRIGHT Shanghai Auto Mart E-Procurement Co., Ltd. 2007 - 2008
 *    All Rights Reserved.
 *
 *    This software is the confidential and proprietary information of
 *    Shanghai Auto Mart E-Procurement Co., Ltd. ("Confidential Information").
 *    You shall not disclose such Confidential Information and shall use it only
 *    in accordance with the terms of the license agreement you entered into 
 *    with Shanghai Auto Mart E-Procurement Co., Ltd.
 *
 * Noties:
 * =============================================================================
 * 
 */

package com.hitrust.gs.action;

import java.util.ArrayList;

import com.hitrust.gs.lib.GSBaseConstants;
import com.hitrust.gs.service.GSBaseAction;
import com.hitrust.gs.service.GSBaseForm;
import com.hitrust.gs.util.exception.GSException;
import com.hitrust.gs.util.page.ResultProcess;
import com.hitrust.gs.vo.GSTemporaryManufactureView;

public class GSTemporaryManufactureExcelDetailAction extends GSBaseAction {

    /* (non-Javadoc)
     * @see com.apep.jzcg.service.GSBaseAction#execute(com.apep.jzcg.service.GSBaseForm)
     */
    public String execute(GSBaseForm aForm) throws Exception {
        // TODO Auto-generated method stub
        String mid=aForm.getRequest().getParameter("mid");
        try {
            ResultProcess rst= (ResultProcess) aForm.getSession().getAttribute("manufactureExcel");
            ArrayList array=rst.getAllRecoreds();
            for (int j = 0; j < array.size(); j++) {
                GSTemporaryManufactureView mv=(GSTemporaryManufactureView) array.get(j);
                if (mid.equals(mv.getGs_recorder_id())) {
                    aForm.getRequest().setAttribute("mdetail", mv);
                }
            }
            if(GSBaseConstants.PLANPRICE.equals("true")){
                aForm.getRequest().setAttribute("isPlanprice", "1");
            }else{
                aForm.getRequest().setAttribute("isPlanprice", "0");
            }
        } catch (Exception e) {
            aForm.getRequest().setAttribute("action", "A400322.do");
            throw new GSException(e.getMessage());
        }
        
        return GSBaseConstants.FORWARD_SUCCESS;
    }

}
